package com.duobaoyu.dby.supply.db.util;

import com.duobaoyu.dby.common.core.util.StringUtil;
import com.duobaoyu.dby.common.mybatis.plugins.AuthUtil;
import lombok.experimental.UtilityClass;

import java.util.Optional;

/**
 * @author yw
 * @description
 * @date 2023/10/8 16:07
 */
@UtilityClass
public class OperateAuthUtil {

	public String getAdministrator(){
		String userName = AuthUtil.getUserName();
		if(StringUtil.isNotBlank(userName)) {
			return userName;
		}
		return Optional.ofNullable(AuthUtil.getUserId()).map(String::valueOf).orElse("系统");
	}
}
